import os
from dotenv import load_dotenv

load_dotenv()

class Settings:
    # MongoDB配置
    MONGODB_URL = os.getenv("MONGODB_URL", "mongodb://localhost:27017")
    DATABASE_NAME = os.getenv("DATABASE_NAME", "site_evaluation")
    COLLECTION_NAME = os.getenv("COLLECTION_NAME", "articles")
    
    # 爬虫配置
    REQUEST_TIMEOUT = int(os.getenv("REQUEST_TIMEOUT", "30"))
    REQUEST_DELAY = float(os.getenv("REQUEST_DELAY", "1.0"))
    MAX_RETRIES = int(os.getenv("MAX_RETRIES", "3"))
    
    # 用户代理配置
    USE_RANDOM_USER_AGENT = os.getenv("USE_RANDOM_USER_AGENT", "true").lower() == "true"
    
    # 行业关键词配置
    INDUSTRY_KEYWORDS = [
        "科技", "金融", "教育", "医疗", "电商",
        "旅游", "餐饮", "房地产", "汽车", "娱乐"
    ]
    
    # 爬虫并发设置
    MAX_CONCURRENT_REQUESTS = int(os.getenv("MAX_CONCURRENT_REQUESTS", "10"))
    
    # 内容过滤设置
    MIN_CONTENT_LENGTH = int(os.getenv("MIN_CONTENT_LENGTH", "100"))
    MAX_CONTENT_LENGTH = int(os.getenv("MAX_CONTENT_LENGTH", "50000"))

settings = Settings() 